#include <boost/test/unit_test.hpp>

#include <phalanx/functional/at.hpp.cu>
using namespace phalanx;

namespace ns_at
{

BOOST_AUTO_TEST_CASE( vector )
{
    const int4 i4 = { 0, 1, 2, 3 };
    BOOST_REQUIRE(( 0 == at< 0 >( i4 ) ));
    BOOST_REQUIRE(( 1 == at< 1 >( i4 ) ));
    BOOST_REQUIRE(( 2 == at< 2 >( i4 ) ));
    BOOST_REQUIRE(( 3 == at< 3 >( i4 ) ));
}

BOOST_AUTO_TEST_CASE( array )
{
    const int a5[ 5 ] = { 0, 1, 2, 3, 4 };
    BOOST_REQUIRE(( 0 == at< 0 >( a5 ) ));
    BOOST_REQUIRE(( 1 == at< 1 >( a5 ) ));
    BOOST_REQUIRE(( 2 == at< 2 >( a5 ) ));
    BOOST_REQUIRE(( 3 == at< 3 >( a5 ) ));
    BOOST_REQUIRE(( 4 == at< 4 >( a5 ) ));
}

} // namespace ns_at

